﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace TX
{
    class Util
    {
        protected void SummarizeOnFooter(ref DevExpress.XtraGrid.Columns.GridColumn col)
        {
            MarkAsNumeric(ref col);
            col.SummaryItem.DisplayFormat = "Grand Total {0:N}";
            col.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
        }

        protected void MarkAsNumeric(ref DevExpress.XtraGrid.Columns.GridColumn col)
        {
            col.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            col.DisplayFormat.FormatString = "#,###.##";
        }

        protected void PostOperations(DevExpress.XtraGrid.Views.Grid.GridView gv, params bool[] showfooter)
        {
            if (showfooter.Length > 0)
                gv.OptionsView.ShowFooter = showfooter[0];
            gv.ExpandAllGroups();
            gv.BestFitColumns();
        }



        //private void btnModified_MouseHover(object sender, EventArgs e)
        //{
        //    DataRow dr = ((DataRowView)(bs[0].Current)).Row;
        //    if (dr.RowState != DataRowState.Detached)
        //        if (!dr.IsNull("ModifiedBy"))
        //            UpdatedBy.Text = dsrepository.Employee.FindByEmployeeID(int.Parse(dr["ModifiedBy"].ToString())).LoginID + " * " + dr["ModifiedOn"].ToString();
        //}

        //private void btnModified_MouseLeave(object sender, EventArgs e)
        //{
        //    UpdatedBy.Text = "UpdatedBy";
        //}


    }
}
